<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/views/global/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath %>">
<%@include file="/views/global/ShopInclude.jsp" %>
<link href="static/css/module/cart.css" rel="stylesheet" type="text/css">
<title>CART</title>
</head>
<body>
<div class="form-container center font">  <!-- 表单填写部分 -->
    <form id="submitForm" name="submitForm" action="buyer/cart/submitCart" method="post">
      <textarea rows="4" cols="50" name="strCartItems" style="display:none"></textarea>
      <div class="cart-title">
      	购物车 CART
      </div>
      <div class="cartTable font">
      	<div class="form-group row cart-table-head">
	    	<div class="col-xs-1" style="width: 5%;">
	    		<input name="cartSelectAll" type="checkbox" class="checkbox selectAll" checked="checked"/>
	    	</div>
	    	<div class="col-xs-1">
	    		全选 ALL
	    	</div>
	    	<div class="col-xs-4">
	    		商品信息NAME
	    	</div>
	    	<div class="col-xs-1" style="width: 10%;">
	    		套餐PACKAGE
	    	</div>
	    	<div class="col-xs-1">
	    		单 价PRICE
	    	</div>
	    	<div class="col-xs-2">
	    		数 量NUMBER
	    	</div>
	    	<div class="col-xs-1">
	    		小 计TOTAL
	    	</div>
	    	<div class="col-xs-1">
	    		
	    	</div>
	    </div>
	    <c:if test="${empty shopCartList }">
	    	<div class="form-group row">
	    		<div class="alert alert-danger">YOUR CART IS EMPTY!</div>
	    	</div>
	    </c:if>
	    <c:forEach var="item" items="${shopCartList }">
	    <div class="form-group row">
	    	<div class="col-xs-1" style="width: 5%;">
	    		<input name="itemSelect" type="checkbox" class="checkbox" checked="checked"
	    			 shopCartId="${item.id }" itemId="${item.itemId }" skuId="${item.skuId }"/>
	    	</div>
	    	<div class="col-xs-1">
	    		<span class="cartItemImg">
	    			<a href="item/detail?id=${item.itemId }" target="_blank"><img width="100" height="100" src="${item.displayFileId }"/></a>
	    		</span>
	    	</div>
	    	<div class="col-xs-4" style="text-align:left;">
	    		<div class="item-info">${item.title }<br/>${item.cnName }</div>
	    	</div>
	    	<div class="col-xs-1" style="width: 10%;">
	    		${item.properties}
	    	</div>
	    	<div class="col-xs-1">
	    		<span class="price">${item.price}</span>
	    	</div>
	    	<div class="col-xs-2">
	    		<ul class="quantitySlipper">
	              <li class="quantityMinus" shopCartId="${item.id }">-</li>
	              <li class="quantityInput">${item.quantity}</li>
	              <li class="quantityPlus" shopCartId="${item.id }">+</li>
	            </ul>
	    	</div>
	    	<div class="col-xs-1">
	    		${item.price * item.quantity}
	    	</div>
	    	<div class="col-xs-1">
	    		<input type="button" class="btn btn-default" value="删 除" onclick="deleteCart(this, '${item.id}')"/>
	    	</div>
	    </div>
	    </c:forEach>
	    <c:if test="${not empty shopCartList }">
	    <div class="form-group row cart-table-foot">
	    	<div class="pull-right">
    			已选商品 ${fn:length(shopCartList) }件, &nbsp;合计 <span class="cartTotalPrice">¥ <span id="totalPrice">${totalPrice }</span></span>
    			&nbsp;&nbsp;
    			<button id="btnCartSubmit" type="button" class="btn btn-success btn-lg font">结 算</button>
    		</div>
	    </div>
	    </c:if>
      </div>
    </form>
  </div>
  
  
</body>
<%@include file="/views/global/AdminScripts.jsp" %>
<script type="text/javascript" src="static/javascript/module/CartCommon.js"></script>
<script type="text/javascript" src="static/javascript/page/cart.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	
});
</script>
</html>
